
<script type="text/javascript" src="<?php echo $this->baseUrl(); ?>
/js/admin-ajax.js"></script>

<?php
$this->title = "Ubah Peran";
$this->headTitle($this->title);
?>
<div id="view-content">
<form>

Cari :	<input type="text" size="10" value="" id="inputString" onkeyup="lookup(this.value,'peran');"  />
</form>
<div class="tabledata" id="tabledata">
<table>
<tr class="head">
    <td>
        <a class="sort" href="<?=$this->url(array('controller'=>'admin',
        'action'=>'changerole', 'order'=>'admin_id','method'=>$this->method))?>">
    ID
    </a></td>
    <td>
        <a class="sort" href="<?=$this->url(array('controller'=>'admin',
        'action'=>'changerole', 'order'=>'name','method'=>$this->method))?>">
    Name</a></td>
    <td>
     <a class="sort" href="<?=$this->url(array('controller'=>'admin',
         'action'=>'changerole', 'order'=>'username','method'=>$this->method))?>">
         Username</a></td>
    <td>
    <a class="sort" href="<?=$this->url(array('controller'=>'admin',
        'action'=>'changerole', 'order'=>'role_id','method'=>$this->method))?>">
        Jabatan</a></td>
</tr>
<?php foreach($this->admins as $admin) : ?>
<tr style="background-color: <?= $this->cycle(array("#ccffcc","#99ff99"))->next(); ?>;">
    <td>
        <?php echo $this->escape($admin['admin_id']);?></td>
    <td><?php echo $this->escape($admin['name']);?></td>
    <td><?php echo $this->escape($admin['username']);?></td>
    <?php

                //Create role DB
                $this->form->role->setLabel("")
                        ->setAttrib("onChange","confirmRole('".$this->url(array('controller'=>'admin',
                           'action'=>'search', 'adminId'=>$admin['admin_id'],'type'=>'change'))."',this.value)")
                        ->setValue($admin['role_id'],$this->role->getRoleName($admin['role_id']));
              
    ?>
    <td><?php echo $this->form;?></td>
</tr>
<?php endforeach; ?>

    <tr>
    <td colspan="7">
           <?= $this->back?>
           <?= $this->current?>/<?=$this->totalPages?>
          <?=$this->next?>
    </td>
</tr>
<tr>
    <td>
                  <a class="listed" href="<?php echo $this->url(array('controller'=>'admin',
            'action'=>'list'));?>">
            <img class="listed" src="<?php echo $this->baseUrl(); ?>/images/icons/arrow_left.png" alt="Back"/>
                    </a>
                </td><td>

    </td>
    </tr>
</table>
    </div>
</div>